package com.cug.nageoffer.common.controller;

import com.cug.nageoffer.common.service.EnterPriseUserService;
import com.cug.nageoffer.model.entity.EnterpriseUser;
import com.cug.nageoffer.model.vo.Result;
import com.cug.nageoffer.model.vo.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "企业端用户相关")
@RestController
@RequestMapping(value = "/api/index/enterpriseUser")
public class EnterPriseUserController {

    @Autowired
    private EnterPriseUserService enterPriseUserService;

    @Operation(summary = "根据用户id查询用户信息")
    @GetMapping(value = "/getUserInfo/{id}")
    public Result<EnterpriseUser> getUserInfo(@PathVariable Long id){
        EnterpriseUser user = enterPriseUserService.getUserInfoById(id);
        return Result.build(user, ResultCodeEnum.SUCCESS);
    }


}
